package jsyf.oa.entity.email;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ccp on 2017/11/6 0006.
 */
@Entity
@Table(name = "T_SYS_EMAIL", schema = "oa", catalog = "")
public class EmailMainEntity extends BaseEntity{
    private String id;
    private String subject;
    private String content;
    private Integer etype;
    private String createUserId;
    private Date createTime;
    private String dataId;
    private String updateUserId;
    private Date updateTime;
    private String parentId;
    private String sender;
    private String reportDate;
    private Integer draft;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getEtype() {
        return etype;
    }

    public void setEtype(Integer etype) {
        this.etype = etype;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReportDate() {
        return reportDate;
    }

    public void setReportDate(String reportDate) {
        this.reportDate = reportDate;
    }

    public Integer getDraft() {
        return draft;
    }

    public void setDraft(Integer draft) {
        this.draft = draft;
    }

    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("SUBJECT", getSubject());
        obj.put("CONTENT", getContent());
        obj.put("DRAFT", getDraft());
        obj.put("E_TYPE", getEtype());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("DATA_ID", getDataId());
        obj.put("UPDATE_USER_ID", getUpdateUserId());
        obj.put("UPDATE_TIME", getUpdateTime());
        obj.put("PARENT_ID", getParentId());
        obj.put("REPORT_DATE",this.getReportDate());
        return obj;
    }

    public JSONObject getJSONObjectId() {
        JSONObject obj = new JSONObject();
        obj.put("id", getId());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_EMAIL ";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("SUBJECT", "subject");
        obj.put("CONTENT", "content");
        obj.put("DRAFT", "draft");
        obj.put("E_TYPE", "etype");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_TIME","createTime");
        obj.put("DATA_ID", "dataId");
        obj.put("UPDATE_USER_ID", "updateUserId");
        obj.put("UPDATE_TIME", "updateTime");
        obj.put("PARENT_ID", "parentId");
        obj.put("REPORT_DATE","reportDate");
        return obj;

    }


}
